package com.example.activitytest

import android.content.Intent
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.activitytest.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {
    private lateinit var binding : ActivityMainBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()

        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        with(binding){
            tvHello.setOnClickListener{
                val str = "Hey,Second"
                val int = 111111111
                val intent = Intent(this@MainActivity,SecondActivity::class.java)//不看下面两排传参数的代码的话，就直接是一个页面跳转的逻辑
                intent.putExtra("chuandi1",str)//加了这两行代码无非就是把数据放到intent中去。
                intent.putExtra("chuandi2",int)
                startActivity(intent)
            }
        }
    }
}